import { Button } from "antd";
import React from "react";
import { useTranslation } from "react-i18next";
import "../../i18n/Index";
function Index() {
  const { t, i18n } = useTranslation();
  const chan = () => {
    i18n.changeLanguage(i18n.language === "zh" ? "en" : "zh");
  };
  return (
    <div>
      <h1>{t("hellow")}</h1>

      <Button onClick={chan}>{i18n.language === "zh" ? "英文" : "中文"}</Button>
      <h1>这是我的中英文切换</h1>
    </div>
  );
}
export default Index;
